<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const num = +prompt("number?", 0);
      /* let fn;
      if (num > 18) {
        fn = () => console.log("hello fn");
      } else {
        fn = () => console.log("hi fn");
      } */
      let fn =
        num > 18 ? () => console.log("hello fn") : () => console.log("hi fn");
    </script>
  </body>
</html>
